Vertex v = (x, y) Model object v0 v1 +----------+ | | | | | | | | +----------+ v2 v3 Matrix M = [ a b ] [ c d ] Matrix times Vertex M * v = [ a b ] * [ x ] = [ a*x + b*y ] [ c d ] [ y ] [ c*x + d*y ] Use the matrix to move the model. v0 = M*v0 // mutate the object referred to by v0, or replace the object referred to by v0? v1 = M*v1 v2 = M*v2 v3 = M*v3 for (int i = 0; i < model.vertexList.length; ++i) model.vertexList.set(i, M.times( model.vertexList.get(i) ); // replace the vertex for (int i = 0; i < model.vertexList.length; ++i) model.vertexList.get(i).times( M ); // mutate the vertex start with a model and, translate it, rotate it, scale it, translate it M1 M2 M3 M4 1_000_000 vertices for (int i = 0; i < model.vertexList.length; ++i) { model.vertexList.get(i).times( M1 ); // mutate the vertex model.vertexList.get(i).times( M2 ); // mutate the vertex model.vertexList.get(i).times( M3 ); // mutate the vertex model.vertexList.get(i).times( M4 ); // mutate the vertex } // 4_000_000 matrix multiplications The above loop does the following to each vertex vi, vi = M4 * (M3 * (M2 * (M1 * vi))) which can be replaced with vi = (M4 * M3 * M2 * M1) * vi // matrix multiply is associative Matrix M5 = M4 * M3 * M2 * M1; 1_000_000 vertices for (int i = 0; i < model.vertexList.length; ++i) { model.vertexList.get(i).times( M5 ); // mutate the vertex } // 1_000_003 matrix multiplications